<template>
  <p>{{ count }}</p>
  <button @click="handleClick">按钮</button>
  <!-- 
    给组件绑定v-model，
      1. 给组件传递属性 modelValue
      2. 给组件绑定自定义事件 update:modelValue

    区别2：v-model可以绑定多个

      v-model:xxx="xxx"
        1. 给组件传递属性 xxx
        2. 给组件绑定自定义事件 update:xxx
   -->
  <Child v-model:count="count" v-model:num="num" />
</template>

<script>
import Child from "./Child.vue";

export default {
  name: "App",
  data() {
    return {
      count: 0,
      num: 0,
    };
  },
  methods: {
    handleClick() {
      this.count++;
    },
  },
  components: {
    Child,
  },
};
// This starter template is using Vue 3 experimental <script setup> SFCs
// Check out https://github.com/vuejs/rfcs/blob/master/active-rfcs/0040-script-setup.md
</script>

<style></style>
